# -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1291614578.836097
_template_filename='/Users/joeldunham/old/onlinelinguisticdatabase/templates/derived/people/index.html'
_template_uri='/derived/people/index.html'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from webhelpers.html import escape
_exports = ['heading', 'displayUsers']


def _mako_get_namespace(context, name):
    try:
        return context.namespaces[(__name__, name)]
    except KeyError:
        _mako_generate_namespaces(context)
        return context.namespaces[(__name__, name)]
def _mako_generate_namespaces(context):
    pass
def _mako_inherit(template, context):
    _mako_generate_namespaces(context)
    return runtime._inherit_from(context, u'/base/index.html', _template_uri)
def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        url = context.get('url', UNDEFINED)
        c = context.get('c', UNDEFINED)
        session = context.get('session', UNDEFINED)
        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 1
        __M_writer(u'\n\n')
        # SOURCE LINE 6
        __M_writer(u'\n\n<p class="descriptiveP">View information about current speakers.  Alterations to the list of speakers will immediately affect the searching and adding of Forms, Files and Collections.</p>\n\n')
        # SOURCE LINE 10
        if 'user_role' in session:
            # SOURCE LINE 11
            __M_writer(u'<a href="')
            __M_writer(escape(url(controller='speaker', action='add')))
            __M_writer(u'" class="buttonLink">Add</a>\n')
            pass
        # SOURCE LINE 13
        __M_writer(u'\n')
        # SOURCE LINE 14
        if c.speakers:
            # SOURCE LINE 15
            __M_writer(u'<div class="containerDiv">\n<table class="clearTable">\n <thead>\n  <tr>\n   <td>ID</td>\n   <td>Name</td>\n   <td>Dialect</td>\n  </tr>\n </thead>\n')
            # SOURCE LINE 24
            for speaker in c.speakers:
                # SOURCE LINE 25
                __M_writer(u'  <tr>\n   <td class="clearTable">')
                # SOURCE LINE 26
                __M_writer(escape(speaker.id))
                __M_writer(u'</td>\n   <td><a href="')
                # SOURCE LINE 27
                __M_writer(escape(url(controller='speaker', action='view', id=speaker.id)))
                __M_writer(u'" class="link" title="View this speaker\'s personal page; edit or delete this speaker (authorization required)">')
                __M_writer(escape(speaker.firstName))
                __M_writer(u' ')
                __M_writer(escape(speaker.lastName))
                __M_writer(u'</a></td>\n   <td>')
                # SOURCE LINE 28
                __M_writer(escape(speaker.dialect))
                __M_writer(u'</td>\n  </tr>\n')
                pass
            # SOURCE LINE 31
            __M_writer(u'</table>\n</div>\n')
            pass
        # SOURCE LINE 34
        __M_writer(u'\n<div class="tableSpacerDivHalf"></div>\n\n\n\n\n<a name=\'users\'></a>\n<h1 class="heading">Users</h1>\n\n<p class="descriptiveP">View information about current users.  Click on the user\'s name to see their personal page.  Click on your own name to view and edit your personal page.</p>\n\n')
        # SOURCE LINE 45
        if 'user_role' in session and session['user_role'] == 'administrator':
            # SOURCE LINE 46
            __M_writer(u' <a href="')
            __M_writer(escape(url(controller='researcher', action='add')))
            __M_writer(u'" class="buttonLink">Add</a>\n')
            pass
        # SOURCE LINE 48
        __M_writer(u'\n')
        # SOURCE LINE 49
        __M_writer(escape(self.displayUsers(c.users)))
        __M_writer(u'\n\n\n')
        # SOURCE LINE 79
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_heading(context):
    context.caller_stack._push_frame()
    try:
        __M_writer = context.writer()
        # SOURCE LINE 3
        __M_writer(u'\n    <a name=\'speakers\'></a>\n    <h1 class="heading">Speakers</h1>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_displayUsers(context,users):
    context.caller_stack._push_frame()
    try:
        url = context.get('url', UNDEFINED)
        session = context.get('session', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 52
        __M_writer(u'\n<div class="containerDiv">\n<table class="clearTable">\n <thead>\n  <tr>\n   <td class="userIDCell">ID</td>\n   <td class="userNameCell">Name</td>\n   <td class="userAffiliationCell">Affiliation</td>\n   <td class="userEmailCell">Email</td>\n  </tr>\n </thead>\n <tbody>\n')
        # SOURCE LINE 64
        for user in users:
            # SOURCE LINE 65
            __M_writer(u'  <tr>\n   <td>')
            # SOURCE LINE 66
            __M_writer(escape(user.id))
            __M_writer(u'</td>\n   <td><a href="')
            # SOURCE LINE 67
            __M_writer(escape(url(controller='researcher', action='view', id=user.id)))
            __M_writer(u'" class="link" title="View this user\'s personal page; edit or delete this user (authorization required)">')
            __M_writer(escape(user.firstName))
            __M_writer(u' ')
            __M_writer(escape(user.lastName))
            __M_writer(u'\n')
            # SOURCE LINE 68
            if 'user_id' in session and user.id == session['user_id']:
                # SOURCE LINE 69
                __M_writer(u' (me)\n')
                pass
            # SOURCE LINE 71
            __M_writer(u'   </a></td>\n   <td>')
            # SOURCE LINE 72
            __M_writer(escape(user.affiliation))
            __M_writer(u'</td>\n   <td>')
            # SOURCE LINE 73
            __M_writer(escape(user.email))
            __M_writer(u'</td>\n  </tr>\n')
            pass
        # SOURCE LINE 76
        __M_writer(u' </tbody>\n</table>\n</div>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


